// RobotWar

RobotWar.Inherits(CanvasApp);
function RobotWar() {
  this.Inherits(CanvasApp, 'canvas');
  this.background('#999999');
  this.corners(15, '#ffffff');
  this.resize(800, 600);
  this.robot = new Robot();
  this.robot.setPos(this.getWidth() / 2, this.getHeight() / 2);
  this.robot.setForce(new Vector(50, 30));
  this.start();
}

// Game logic update
RobotWar.prototype.update = function(canvas, dt) {
  this.robot.update(dt);
  this.robot.setForce(new Vector(0, 0));
  canvas.redraw();
  CanvasApp.prototype.update.call(this, canvas, dt);
};

// Called when a redraw() has been issued
RobotWar.prototype.draw = function(ctx) {
  this.robot.draw(ctx);
  CanvasApp.prototype.draw.call(this, ctx);
};
